﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using ZX.EHR.Library;
using ZX.Web.UI.Controls;

namespace ZX.WebApp.EHR
{
    public partial class GetCurrentUser : BasePage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                string empId = this.User.EmpID.ToString();
                string empName = this.User.UName;
                //获取部门ID
                ZX.EHR.Library.hrEmployee instance = ZX.Common.Globals.getEntity("hrEmployee") as ZX.EHR.Library.hrEmployee;
                ZX.BLL.Extend.BaseBussnies deptBll = new ZX.BLL.Extend.BaseBussnies(instance);
                string condition = string.Format("ID='{0}'", empId);
                ZX.EHR.Library.hrEmployee hrEmp = deptBll.GetEntityByCondition(condition) as ZX.EHR.Library.hrEmployee;
                string deptId = hrEmp.DepartmentID.ToString();//部门ID
                string empCode = hrEmp.EmployeeCode;
                HttpContext.Current.Response.Write(empId + "_" + empName + "_" + deptId + "_" + empCode);
            }
            catch
            {
                HttpContext.Current.Response.Write("-1");
            }
        }
    }
}